//
// Copyright (c) 2024 BPer
//
#include <bpersdp/BPerCodecPayload.h>


void bPer_insert_fbsVector(BPerFbsVector* vec,char* str){
	if(vec->vlen>=vec->capacity){
		char** tmp=(char**)bPer_malloc(vec->vlen*sizeof(char*));
		bPer_memcpy(tmp,vec->groups,vec->vlen*sizeof(char*));
		bPer_free(vec->groups);
		vec->groups=(char**)bPer_malloc((vec->capacity+10)*sizeof(char*));
		bPer_memcpy(vec->groups,tmp,vec->vlen*sizeof(char*));
		bPer_free(tmp);
		vec->capacity+=10;
	}
	vec->groups[vec->vlen]=(char*)bPer_calloc(bPer_strlen(str)+1,1);
	bPer_strcpy(vec->groups[vec->vlen],str);
	vec->vlen++;
}
void bPer_init_sdpVector(BPerFbsVector* vec){
	vec->capacity=10;
	vec->groups=(char**)bPer_calloc(vec->capacity*sizeof(char*),1);
	vec->vlen=0;
}
